Method and apparatus for paying fare

ABSTRACT

Some embodiments of the application disclose a method and apparatus for paying a fare. When a user takes a public transit means, the user terminal establishes an NFC connection with the fare-collecting device of the public transit means, the user terminal transmits the encrypted account ID of the user to the fare-collecting device, and the fare-collecting device may request a server to deduct the fare from the account of the user.

CROSS REFERENCE TO RELATED APPLICATION

The present application is a continuation application of InternationalPatent Application No. PCT/CN2018/105951, filed on Sep. 17, 2018, whichclaims priority to Chinese Patent Application No. 201711054359.7, filedon Oct. 31, 2017. The entire content of the above referencedapplications is incorporated herein by reference.

TECHNICAL FIELD

The application relates to the field of information technology, and inparticular relates to a method and apparatus for paying a fare.

BACKGROUND

Currently, the method of using the near field communication (NFC)function of a user terminal (for example, a mobile phone) to simulatethe user terminal has come into use (e.g., as shown in FIG. 1, a mobilephone may be simulated into a public transit card so that the user cantake a public transit means by “swiping the mobile phone.”).

Generally, the user terminal which simulates a public transit card musthave at least the following three hardware units: NFC front-end chip,NFC antenna and security chip. Among them, the NFC front-end chip andthe NFC antenna are used to realize NFC communication, and the accountID and account balance of the public transit card are stored in thesecurity chip in the form of hardware encryption, that is, the functionof the security chip is to prevent the account balance from beingmaliciously tampered.

When using a user terminal to takes a public transit means, a user movesthe user terminal close to a fare-collecting device of the publictransit means, the fare-collecting device establishes an NFC connectionwith the user terminal, and the fare-collecting device has thepermission to update the account balance stored in the security chip inthe user terminal (for example, rewrite RMB100 into RMB98) over the NFCconnection to collect the fare.

Based on the prior art, a low-cost method for paying a fare is desired.

SUMMARY

Some embodiments of the application provide a method and apparatus forpaying a fare to solve the problem with the prior high-cost method forpaying a fare.

To solve the above-mentioned technical problem, some embodiments of theapplication are realized in such a way:

The method for paying a fare in some embodiments of the applicationcomprises: establishing, by a fare-collecting device of a public transitmeans, a near field communication (NFC) connection with a user terminal;receiving over the NFC connection encrypted data transmitted from theuser terminal; decrypting the encrypted data to obtain an account ID ofa user associated with the user terminal; and determining whether tosend the account ID to a server for the server to deduct a fare from anaccount corresponding to the account ID.

In some embodiments, decrypting the encrypted data to obtain the accountID comprises: decrypting the encrypted data to obtain the account ID anda timestamp, and determining whether to send the account ID to theserver comprises: determining whether a time interval between a timecorresponding to the timestamp to a current time satisfies a condition;if yes, determining to send the account ID to the server; and if no,determining not to send the account ID to the server.

In some embodiments, decrypting the encrypted data to obtain the accountID further comprises: decrypting the encrypted data to obtain theaccount ID and a device ID, and determining whether to send the accountID to the server further comprises: determining whether the device ID isconsistent with a device ID of the fare-collecting device; if yes,determining to send the account ID to the server; and if no, determiningnot to send the account ID to the server.

In some embodiments, in response to determining not to send the accountID to the server, the method further comprises at least one of thefollowing: reporting an error; and closing an entrance.

In some embodiments, in response to determining to send the account IDto the server, the method further comprises opening the entrance.

In some embodiments, the encrypted data comprises: the account ID of theuser associated with the user terminal and a timestamp corresponding toa time when the encrypted data is encrypted.

In some embodiments, the encrypted data comprises: the account ID of theuser associated with the user terminal and a device ID of thefare-collecting device.

In another aspect of the present disclosure, a computing system maycomprise one or more processors and one or more non-transitorycomputer-readable memories coupled to the one or more processors andconfigured with instructions executable by the one or more processors.Executing the instructions may cause the system to perform operations.The operations may include establishing, by a fare-collecting device ofa public transit means, a near field communication (NFC) connection witha user terminal; receiving over the NFC connection encrypted datatransmitted from the user terminal; decrypting the encrypted data toobtain an account ID of a user associated with the user terminal; anddetermining whether to send the account ID to a server for the server todeduct a fare from an account corresponding to the account ID.

Yet another aspect of the present disclosure is directed to anon-transitory computer-readable storage medium configured withinstructions executable by one or more processors to cause the one ormore processors to perform operations. The operations may includeestablishing, by a fare-collecting device of a public transit means, anear field communication (NFC) connection with a user terminal;receiving over the NFC connection encrypted data transmitted from theuser terminal; decrypting the encrypted data to obtain an account ID ofa user associated with the user terminal; and determining whether tosend the account ID to a server for the server to deduct a fare from anaccount corresponding to the account ID.

BRIEF DESCRIPTION OF THE DRAWINGS

To describe some embodiments of the application more clearly, thefollowing briefly describes the drawings in the description of someembodiments. The drawings in the following description are used forillustration purpose, and do not limit the scope of this specification.Without creative work, those skilled in the art may obtain otherdrawings on the basis of these drawings.

FIG. 1 shows a method of paying a fare by simulating a mobile phone intoa public transit card.

FIG. 2 is a flowchart of a method for paying a fare in some embodimentsof the application.

FIG. 3 is a schematic diagram for an apparatus for paying a fare in someembodiments of the application.

FIG. 4 is a schematic diagram for another apparatus for paying a fare insome embodiments of the application.

FIG. 5 is a schematic diagram for a device for paying a fare in someembodiments of the application.

FIG. 6 is a schematic diagram for another device for paying a fare insome embodiments of the application.

DETAILED DESCRIPTION

Currently, a user terminal must have hardware units such as NFCfront-end chip, NFC antenna and security chip so that the user can takea public transit means such as bus or subway by “swiping a mobilephone.” However, requiring a user terminal, for example, a mobile phoneto have a security chip will lead to high hardware cost of the mobilephone, and furthermore, a large number of mobile phones available on themarket have no security chip, and the users of these mobile phones maynot be able to enjoy the convenience of taking a public transit means by“swiping a mobile phone.”

In some embodiments of the application, a user's account balance may notbe stored in a user terminal. The account of the user may be maintainedby a server. The NFC front-end chip and NFC antenna of the user terminalmay be utilized so that the user terminal may establish an NFCconnection with the fare-collecting device of a public transit means,where the user terminal transmits the account ID of the user to thefare-collecting device, and then the fare-collecting device requests theserver to deduct a fare from the account corresponding to the accountID.

For the convenience of description, the public transit means in thefollowing description is a subway. The technical solutions in someembodiments of the application are described in detail below incombination with the drawings.

FIG. 2 is a flowchart of a method for paying a fare in some embodimentsof the application and the method comprises the following steps.

S200: A user terminal establishes an NFC connection with thefare-collecting device of a public transit means.

In some embodiments of the application, the user terminal may be amobile phone, a tablet PC, a notebook PC or a smart device which may beapplied in a mobile payment scenario. The fare-collecting device of thepublic transit means may be a subway gate or a card reader on a bus, andthe fare-collecting device is a subway gate in the followingdescription.

In this step, the user may move the user terminal close to thefare-collecting device, and when the distance between the user terminaland the fare-collecting device is not greater than the NFC inductiondistance, the user terminal may establish an NFC connection with thefare-collecting device.

The establishment of an NFC connection may be independent of theInternet or LAN, and therefore, when both the user terminal and thefare-collecting device are offline, an NFC connection may still beestablished between them.

S202: The user terminal encrypts the account ID of the user according toan encryption algorithm of the public transit system to obtain encrypteddata.

S204: The user terminal transmits the encrypted data to thefare-collecting device over the NFC connection.

In some embodiments of the application, in order to prevent the accountID of the user from being maliciously intercepted during thetransmission, the user terminal may encrypt the account ID of the userand transmit the encrypted data to the fare-collecting device over theNFC connection. In this way, even if the encrypted data is interceptedby a malicious user during the transmission, the lawbreaker cannotdecrypt the encrypted data to obtain the account ID of the user.

The encryption algorithm the user terminal uses to encrypt the accountID in step S202 may be an encryption algorithm applicable to datatransmission between the user terminal and the public transit means. Theencryption algorithm may be executed by a payment application installedon the user terminal. The encryption algorithm may be agreed on inadvance between the payment application and the public transit system(for example, a server of a subway corporation).

S206: The fare-collecting device receives over the NFC connection theencrypted data transmitted from the user terminal.

S208: The fare-collecting device decrypts the encrypted data to obtainthe account ID.

S210: The fare-collecting device determines whether to send the accountID to a server for the server to deduct a fare from an accountcorresponding to the account ID.

In some embodiments of the application, the fare-collecting device mayacquire the account ID after decrypting the encrypted data. Later, thefare-collecting may send the account ID obtained by decrypting theencrypted data to the server and the server may deduct the fare from theaccount corresponding to the account ID.

When a payment application is installed on the user terminal and theaccount ID is encrypted by the payment application, the server is theserver corresponds to the payment application.

In addition, if the subway the user takes is in segment charging mode,the fare-collecting device may need to acquire over the NFC connectionthe encrypted data transmitted from the user terminal when the userenters and leaves a station (gets on and off when the user takes a bus).When the user enters a station, the fare-collecting device may make arecord according to the account ID obtained by decrypting the encrypteddata, and when the user leaves a station, the fare-collecting maycalculate the fare according to the account ID obtained by decryptingthe encrypted data and send the account ID and the fare to the server tocause the server to deduct the fare from the account corresponding tothe account ID.

If the subway the user takes is in uniform charging mode (the fare isfixed regardless of the mileage), the fare-collecting device acquiresthe account ID and sends the account ID to the server when the userenters a station, and the server deducts the RMB2 fare from the accountcorresponding to the account ID.

In the prior method for paying a fare, a user terminal having the threehardware units of an NFC front-end chip, an NFC antenna and a securitychip is equivalent to a public transit card, in which an account balanceis stored, the user enters or leaves a station by moving the userterminal close to the induction zone of a subway gate, and thefare-collecting device may update the account balance stored in thesecurity chip of the user terminal to complete fare deduction.

In some embodiments of the application, no account balance may be storedin a user terminal, the fare-collecting device may not directly performa fare deduction operation, and the fare-collecting device may requestthe server to deduct a fare from the account of a user. The account IDof the user may be obtained by registering an account on the server.Therefore, the fare-collecting device may need to send the account IDsent by the user terminal to the server to request the server to deductthe fare from the account of the user. In this way, the fare-collectingdevice may complete a fare collection.

In addition, user A may theoretically use the encrypted data obtained byencrypting the account ID of user B to enter a station. That is, whenuser B enters a station, user A may intercept the encrypted datatransmitted from the user terminal of user B to the fare-collectingdevice, and later use the encrypted data to enter the station, and theserver may also deduct a fare from the account of user A.

To prevent this case, the user terminal may acquire the correspondingtimestamp of the current time and encrypts the account ID of the userand the timestamp to obtain encrypted data in step S202. In step S208,the fare-collecting device may decrypt the encrypted data to obtain theaccount ID and the timestamp, and in step S210, the fare-collectingdevice may determine whether the time interval from the timestampobtained by decrypting the encrypted data to the current time satisfiesa specified condition. If yes, the fare-collecting device may send theaccount ID to the server, and if no, the fare-collecting device mayrefuse to send the account ID to the server. The specified condition maybe a specified time length, and may be specified according to therequirement, for example, to be 5 seconds.

In this way, even if user B intercepts the encrypted data and later usesthe encrypted data to enter a station, the fare-collecting device maydetermine that the encrypted data is invalid because of timeout and thefare-collecting device may refuse to send the account ID to the server.

In addition, when the encrypted data is obtained by the user terminal ofuser A by encrypting the account ID and the corresponding timestamp ofthe current time, user B may be prevented from later going into thestation after intercepting the encrypted data. However, user B may usethe intercepted encrypted data to enter the station from another subwaygate at the moment when user A enters the station.

Therefore, in step S202, the user terminal may further acquire thedevice ID of the fare-collecting device and encrypt the account ID ofthe user, the corresponding timestamp of the current time and the deviceID to obtain encrypted data. The user terminal may acquire the device IDover the established NFC connection. In step S208, the fare-collectingdevice may decrypt the encrypted data to obtain the account ID,timestamp and device ID. In step S210, the fare-collecting device notonly needs to determine whether the time interval from the timecorresponding to the timestamp obtained by decrypting the encrypted datato the current time satisfies a specified condition, but also needs todetermine whether the device ID obtained by decrypting the encrypteddata is consistent with its own device ID. If the two determinationresults are both yes, the fare-collecting device may send the account IDto the server, and if either determination result is no, thefare-collecting device may refuse to send the account ID to the server.

In this way, even if user B intercepts the encrypted data of user A andenters the station from another subway gate (or get on another bus) atthe moment when user A enters the station, another subway gate may alsodetermine that the device ID obtained by decrypting the encrypted datais not its own device ID and thus may refuse to send the account ID tothe server.

In some embodiments, the timestamp and the device ID adopted in theabove-mentioned technical means may be used separately. That is, theuser terminal may encrypt the account ID and the corresponding timestampof the current time to obtain encrypted data, or encrypt the account IDand the device ID of the fare-collecting device to obtain encrypteddata.

In addition, in some embodiments of the application, when thefare-collecting device is online, the fare-collecting device may openthe entrance and/or report no error to allow a user to enter a stationor get on a bus while sending the account ID to the server. Thefare-collecting device may report an error and/or close the entrance toprevent the user from entering the station or getting on the bus andrefuse to send the account ID to the server.

When the fare-collecting device is offline, if the fare-collectingdevice refuses to send the account ID to the server, the fare-collectingdevice may report an error and/or close the entrance to prevent the userfrom going into the station or getting on the bus. If thefare-collecting device needs to send the account ID to the server, thefare-collecting device may first store the account ID to be sent andopen the entrance and/or report no error to allow the user to go intothe station or get on the bus. Then, the fare-collecting device may sendthe stored account ID to the server when it is connected to a network.

Through the method shown in FIG. 2, no security chip is required for auser terminal, and thus the corresponding hardware cost is saved. Inaddition, the account balance of a user is recorded and modified by theserver, and the user may still take a public transit means by “swiping amobile phone.” Even if the user terminal of the user has no securitychip, the user may move the user terminal close to a subway gate toenter a station and experience the “touch payment.”

On the basis of the method for paying a fare in FIG. 2, some embodimentsof the application further provide an apparatus for paying a fareaccordingly. As shown in FIG. 3, the apparatus comprises: anestablishment module 301, configured to establish an NFC connection withthe fare-collecting device of a public transit means, an encryptionmodule 302, configured to encrypt the account ID of a user according tothe pre-agreed encryption algorithm of a public transit system to obtainencrypted data, and a transmission module 303, configured to transmitthe encrypted data to the fare-collecting device over the NFC connectionso that the fare-collecting device decrypts the encrypted data to obtainthe account ID and sends the account ID to a server to cause the serverto deduct a fare from the account corresponding to the account ID.

In some embodiments, the encryption module 302 may acquire thecorresponding timestamp of the current time and encrypt the account IDof a user and the timestamp to obtain encrypted data.

In some embodiments, the encryption module 302 may acquire the device IDof the fare-collecting device over the NFC connection and encrypt theaccount ID of a user and the device ID to obtain encrypted data.

On the basis of the method for paying a fare in FIG. 2, some embodimentsof the application further provide another apparatus for paying a fareaccordingly. As shown in FIG. 4, the apparatus comprises: anestablishment module 401, configured to establish an NFC connection witha user terminal, a receiving module 402, configured to receive over theNFC connection the encrypted data transmitted from the user terminal, adecryption module 403, configured to decrypt the encrypted data toobtain the account ID of the user, and a sending module 404, configuredto send the account ID to a server so that the server deducts a farefrom the account corresponding to the account ID.

The decryption module 403 may decrypt the encrypted data to obtain theaccount ID and the timestamp, and the sending module 404 may determinewhether the time interval from the corresponding time of the timestampto the current time satisfies a specified condition; if yes, the sendingmodule may send the account ID to a server, and if no, the sendingmodule may refuse to send the account ID to the server.

The decryption module 403 may decrypt the encrypted data to obtain theaccount ID and the device ID, and the sending module 404 may determinewhether the device ID obtained from the decryption is consistent withits own device ID; if yes, the sending module may send the account ID toa server, and if no, the sending module may refuse to send the accountID to the server.

The sending module 404 may send the account ID to a server and open theentrance and/or reports no error, or refuse to send the account ID tothe server and report an error and/or closes the entrance.

On the basis of the method for paying a fare in FIG. 2, some embodimentsof the application further provide a device for paying a fareaccordingly. As shown in FIG. 5, the device comprises one or moreprocessors and a memory, a program is stored in the memory and thedevice is so configured that the one or more processors perform thefollowing steps: establishing an NFC connection with the fare-collectingdevice of a public transit means, encrypting the account ID of the useraccording to the pre-agreed encryption algorithm of a public transitsystem to obtain encrypted data, and transmitting the encrypted data tothe fare-collecting device over the NFC connection so that thefare-collecting device decrypts the encrypted data to obtain the accountID and sends the account ID to a server to cause the server to deduct afare from the account corresponding to the account ID.

On the basis of the method for paying a fare in FIG. 2, some embodimentsof the application further provide another device for paying a fareaccordingly. As shown in FIG. 6, the device comprises one or moreprocessors and a memory, a program is stored in the memory and thedevice is so configured that the one or more processors perform thefollowing steps: establishing an NFC connection with a user terminal,receiving over the NFC connection the encrypted data transmitted fromthe user terminal, decrypting the encrypted data to obtain the accountID of the user, and sending the account ID to a server so that theserver deducts a fare from the account corresponding to the account ID.

Some embodiments in the description are described in a progressive way.For the same or similar parts between some embodiments, refer to theseembodiments. Each embodiment focuses the differences from the others.Especially, for the devices in FIGS. 5 and 6, since they are similar tothe embodiment of the method, their descriptions are brief. The relevantembodiments of the devices may be referred to the descriptions of theembodiments of the method.

In the 1990s, it may be obvious whether a technical improvement is ahardware improvement (for example, improvement of the circuit structureof a diode, a transistor or a switch) or software improvement (forexample, improvement of the method process). However, with thedevelopment of technologies, the improvements of today's methodprocesses have already been considered as direct improvements ofhardware circuit structures. Designers may almost obtain a hardwarecircuit structure by programming an improved method process into ahardware circuit. Therefore, the improvement of a method process may berealized by hardware entity modules. For example, a programmable logicdevice (PLD), such as a field programmable gate array (FPGA) is such anintegrated circuit whose logic function is determined by programming thedevice. Designers may themselves program a digital system to “integrate”it into a PLD, without asking a chip manufacturer to design andmanufacture an application specific integrated circuit (ASIC) chip.Nowadays, programming which replaces manual manufacturing of integratedcircuit chips is mostly done by a logic compiler, which is similar to asoftware compiler used for program development and writing. Originalcodes before compilation also need to be written by use of a specificprogramming language, for example, hardware description language (HDL).However, HDL is not the only programming language, and many otherprogramming languages, for example, Advanced Boolean Expression Language(ABEL), Altera Hardware Description Language (AHDL), Confluence, CornellUniversity Programming Language (CUPL), HDCal, Java Hardware DescriptionLanguage (JHDL), Lava, Lola, MyHDL, PALASM, and Ruby HardwareDescription Language (RHDL) may be used. Currently, Very-High-SpeedIntegrated Circuit Hardware Description Language (VHDL) and Verilog arethe most commonly used. A hardware circuit realizing a logic methodprocess may easily be obtained by using some of the above-mentionedhardware description languages to perform logic programming for themethod process and program it into an integrated circuit.

A controller may be realized in a proper way. For example, a controllermay be a microprocessor or processor, a computer-readable medium inwhich computer-readable program codes (for example, software orfirmware) executed by the (micro)processor are stored, a logic gate, aswitch, an application specific integrated circuit (ASIC), aprogrammable logic controller and an embedded micro controller. Examplesof a controller include but are not limited to the followingmicrocontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 andSilicone Labs C8051F320, and a memory controller may be realized as apart of the control logic of the memory. Those skilled in the art alsoknow that besides a controller may be realized in the way ofcomputer-readable program codes, the same function may completely berealized in the form of a logic gate, switch, ASIC, programmable logiccontroller, embedded microcontroller through logic programming of theprocedure of a method. Therefore, such a controller may be considered asa hardware component and the devices configured to realize differentfunctions in the hardware component may also be considered as structuresin the hardware component. Or, the devices configured to realizedifferent functions may even be considered as not only software modulesrealizing a method, but also structures in the hardware component.

The system, apparatus, modules or units described in some embodimentsabove may be realized by a computer chip or entity, or realized by aproduct having a function. A typical device is a computer. Specifically,the computer may be a personal computer, a laptop computer, a cellularphone, a camera phone, a smart phone, a personal digital assistant, amedia player, a navigation device, an e-mail device, a game console, atablet computer, a wearable device or any combination of these devices.

For the convenience of description, when the apparatus is described, theapparatus is functionally divided into different units and these unitsare described respectively. In some embodiments, the functions ofdifferent units may be realized in one or more pieces of software and/orhardware.

Some embodiments of the application may provide a method, a system or acomputer program product. Therefore, hardware-only embodiments,software-only embodiments or embodiments combining software withhardware may be adopted for the application. In addition, the embodimentof a computer program product which may be implemented on one or morecomputer accessible storage media (including but not limited to diskmemory, CD-ROM and optical memory) containing computer program codes maybe adopted for the application.

The application is described by reference to the flowchart and/or blockdiagram of the method, device (system) and computer program product ofsome embodiments of the application. Each process in the flowchartand/or block in the block diagram and the combination of the processesin the flowchart and/or the blocks in the block diagram may be realizedby computer program commands. These computer program commands may beprovided in a general-purpose computer, a dedicated computer, anembedded processor or the processor of other programmable dataprocessing equipment to produce a machine so that the commands executedby a computer or the processor of other programmable data processingequipment may produce a device configured to realize the designatedfunctions in one process or more processes in the flowchart and/or inone block or more blocks in the block diagram.

These computer program commands may also be stored in acomputer-readable memory which may boot a computer or other programmabledata processing equipment to work in a specific mode so that thecommands stored in the computer-readable memory may produce manufacturesincluding a command device. The command device realizes the designatedfunctions in one process or more processes in the flowchart and/or inone block or more blocks in the block diagram.

These computer program commands may also be uploaded to a computer orother programmable data processing equipment so that a series ofoperation steps are performed on the computer or other programmable dataprocessing equipment to produce the processing realized by the computerand the commands executed on the computer or other programmable dataprocessing equipment provide the steps for realizing the designatedfunctions in one process or more processes in the flowchart and/or inone block or more blocks in the block diagram.

In a typical configuration, a computer device comprises one or moreprocessors (CPU), an input/output interface, a network interface and amemory.

The memory may include a volatile memory, a random-access memory (RAM)and/or a nonvolatile memory of computer-readable media, for example, aread-only memory or a flash RAM. The memory is an example ofcomputer-readable media.

Computer-readable media include volatile and nonvolatile media andmobile and immobile media, and they may realize information storage byuse of any method or technique. Information may be computer-readablecommands, data structures, modules of a program or other data. Examplesof storage media of a computer include but are not limited tophase-change RAM (PRAM), static random access memory (SRAM), dynamicrandom access memory (DRAM), other types of random access memory (RAM),read-only memory (ROM), electrically erasable programmable read-onlymemory (EEPROM), flash memory or other memory techniques, compact diskread-only memory (CD-ROM), digital versatile disk (DVD), cassette tape,magnetic tape, magnetic disk or other storage device or any othernon-transmission medium, and they may be configured to store informationwhich may be accessed by a computer device. According to the definitionin this document, computer-readable media excludes transitory media, forexample, modulated data signals and carriers.

The terms “comprise” and “contain” and their variants are intended tocover non-exclusive inclusions so that the process, method, commodity ordevice comprising a series of elements not only comprises theseelements, but also comprises other elements not listed clearly, orcomprises the elements intrinsic to the process, method, commodity ordevice. Without any more restrictions, the element defined by“comprising one . . . ” do not exclude the case that other identicalelements exist in the process, method, commodity or device whichcomprises the element.

Some embodiments of the application may provide a method, a system or acomputer program product. Therefore, hardware-only embodiments,software-only embodiments or embodiments combining software withhardware may be adopted for the application. In addition, the embodimentof a computer program product which may be implemented on one or morecomputer accessible storage media (including but not limited to diskmemory, CD-ROM and optical memory) containing computer program codes maybe adopted for the application.

The application may be described in the general context of a computerexecutable command executed by a computer, for example, a programmodule. Generally, a program module comprises a routine, program,object, component and data structure which execute a specific task orrealize a specific abstract data type. The application may also bepracticed in distributed computing environments. In the distributedcomputing environments, tasks are executed by remote processingequipment connected over a communication network. In distributedcomputing environments, a program module may be located in a local orremote computer storage medium including a storage device.

The above are only embodiments of the application, but are not used torestrict the application. Those skilled in the art may make variouschanges and modifications to the application. Any modification,equivalent replacement, and improvement within the spirit and principleof the application should fall within the scope of the claims of theapplication.

1. A method for paying a fare, comprising: establishing, by afare-collecting device, a near field communication (NFC) connection witha user terminal; receiving over the NFC connection encrypted datatransmitted from the user terminal; decrypting the encrypted data toobtain an account ID of a user associated with the user terminal; anddetermining whether to send the account ID to a server for the server todeduct a fare from an account corresponding to the account ID.
 2. Themethod as claimed in claim 1, wherein decrypting the encrypted data toobtain the account ID comprises: decrypting the encrypted data to obtainthe account ID and a timestamp, and determining whether to send theaccount ID to the server comprises: determining whether a time intervalbetween a time corresponding to the timestamp to a current timesatisfies a condition; if yes, determining to send the account ID to theserver; and if no, determining not to send the account ID to the server.3. The method as claimed in claim 1, wherein decrypting the encrypteddata to obtain the account ID further comprises: decrypting theencrypted data to obtain the account ID and a device ID, and determiningwhether to send the account ID to the server further comprises:determining whether the device ID is consistent with a device ID of thefare-collecting device; if yes, determining to send the account ID tothe server; and if no, determining not to send the account ID to theserver.
 4. The method as claimed in claim 1, wherein in response todetermining not to send the account ID to the server, the method furthercomprises at least one of the following: reporting an error; and closingan entrance.
 5. The method as claimed in claim 1, wherein in response todetermining to send the account ID to the server, the method furthercomprises: opening an entrance.
 6. The method as claimed in claim 1,wherein the encrypted data comprises: the account ID of the userassociated with the user terminal and a timestamp corresponding to atime when the encrypted data is encrypted.
 7. The method as claimed inclaim 1, wherein the encrypted data comprises: the account ID of theuser associated with the user terminal and a device ID of thefare-collecting device.
 8. A system for paying a fare, comprising aprocessor and a non-transitory computer-readable storage medium storinginstructions executable by the processor to cause the system to performoperations comprising: establishing, by a fare-collecting device, a nearfield communication (NFC) connection with a user terminal; receivingover the NFC connection encrypted data transmitted from the userterminal; decrypting the encrypted data to obtain an account ID of auser associated with the user terminal; and determining whether to sendthe account ID to a server for the server to deduct a fare from anaccount corresponding to the account ID.
 9. The system as claimed inclaim 8, wherein decrypting the encrypted data to obtain the account IDcomprises: decrypting the encrypted data to obtain the account ID and atimestamp, and determining whether to send the account ID to the servercomprises: determining whether a time interval between a timecorresponding to the timestamp to a current time satisfies a condition;if yes, determining to send the account ID to the server; and if no,determining not to send the account ID to the server.
 10. The system asclaimed in claim 8, wherein decrypting the encrypted data to obtain theaccount ID further comprises: decrypting the encrypted data to obtainthe account ID and a device ID, and determining whether to send theaccount ID to the server further comprises: determining whether thedevice ID is consistent with a device ID of the fare-collecting device;if yes, determining to send the account ID to the server; and if no,determining not to send the account ID to the server.
 11. The system asclaimed in claim 8, wherein in response to determining not to send theaccount ID to the server, the operations further comprise at least oneof the following: reporting an error; and closing an entrance.
 12. Thesystem as claimed in claim 8, wherein in response to determining to sendthe account ID to the server, the operations further comprise: openingan entrance.
 13. The system as claimed in claim 8, wherein the encrypteddata comprises: the account ID of the user associated with the userterminal and a timestamp corresponding to a time when the encrypted datais encrypted.
 14. The system as claimed in claim 8, wherein theencrypted data comprises: the account ID of the user associated with theuser terminal and a device ID of the fare-collecting device.
 15. Anon-transitory computer-readable storage medium for paying a fare,configured with instructions executable by one or more processors tocause the one or more processors to perform operations comprising:establishing, by a fare-collecting device, a near field communication(NFC) connection with a user terminal; receiving over the NFC connectionencrypted data transmitted from the user terminal; decrypting theencrypted data to obtain an account ID of a user associated with theuser terminal; and determining whether to send the account ID to aserver for the server to deduct a fare from an account corresponding tothe account ID.
 16. The non-transitory computer-readable storage mediumas claimed in claim 15, wherein decrypting the encrypted data to obtainthe account ID comprises: decrypting the encrypted data to obtain theaccount ID and a timestamp, and determining whether to send the accountID to the server comprises: determining whether a time interval betweena time corresponding to the timestamp to a current time satisfies acondition; if yes, determining to send the account ID to the server; andif no, determining not to send the account ID to the server.
 17. Thenon-transitory computer-readable storage medium as claimed in claim 15,wherein decrypting the encrypted data to obtain the account ID furthercomprises: decrypting the encrypted data to obtain the account ID and adevice ID, and determining whether to send the account ID to the serverfurther comprises: determining whether the device ID is consistent witha device ID of the fare-collecting device; if yes, determining to sendthe account ID to the server; and if no, determining not to send theaccount ID to the server.
 18. The non-transitory computer-readablestorage medium as claimed in claim 15, wherein in response todetermining not to send the account ID to the server, the operationsfurther comprise at least one of the following: reporting an error; andclosing an entrance.
 19. The non-transitory computer-readable storagemedium as claimed in claim 15, wherein in response to determining tosend the account ID to the server, the operations further comprise:opening an entrance.
 20. The non-transitory computer-readable storagemedium as claimed in claim 15, wherein the encrypted data comprises: theaccount ID of the user associated with the user terminal and a timestampcorresponding to a time when the encrypted data is encrypted.